[id].vue 624 B

1234567891011121314151617181920212223
  1. <template>
  2. <LayoutContainer>
  3. <div>
  4. <h2>{{ $t('cycle') }}</h2>
  5. <UiFormEdition :model="Cycle" go-back-route="/parameters/teaching">
  6. <template #default="{ entity }">
  7. <UiInputText v-model="entity.label" field="label" :rules="rules()" />
  8. </template>
  9. </UiFormEdition>
  10. </div>
  11. </LayoutContainer>
  12. </template>
  13. <script setup lang="ts">
  14. import { useI18n } from 'vue-i18n'
  15. import Cycle from '~/models/Education/Cycle'
  16. const i18n = useI18n()
  17. const rules = () => [
  18. (label: string | null) =>
  19. (label !== null && label.length > 0) || i18n.t('please_enter_a_value'),
  20. ]
  21. </script>